import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

export default function poolApprovalAPI(api) {
  return {
    // 获取券池名称下拉
    getPoolName: (query) => api.post(`${config.interfaces.type5}portfolio-server/SecurityPool/findAll`, query),
    // 获取流程申请人
    getApplyPeople: (query) => api.post(`${config.interfaces.type5}portfolio-server/user/findAll`, query),
    // 手动入池新增&&修改
    getAdd: (query) => api.post(`${config.interfaces.type5}portfolio-server/flowSecurity/addOrUpdate`, query),
    // 查询审批列表数据
    findAll: (query) => api.post(`${config.interfaces.type5}portfolio-server/flowSecurity/findFlowSecurity`, query),
    // 获取详细信息
    getDetails: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/findFlowSecurityById`, query),
    // 获取标签
    findTag: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/flowSecurityTag`, query),
    // 获取研究员
    findResearcher: (query) => api.get(`${config.interfaces.type5}portfolio-server/role/getUserByRoleAndTenant`, query),
    // 自动入池新增&&修改
    autoAdd: (query) => api.post(`${config.interfaces.type5}portfolio-server/flowSecurity/auto-edit`, query),
    // 标的校验
    checkAdd: (query) => api.post(`${config.interfaces.type5}portfolio-server/flowSecurity/checkItem`, query),
    // 内容模糊搜索
    searchContent: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/findissuer`, query),
    // 出池时带出标签值
    bringTag: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/findItemTag`, query),
    // 查询行业和研究员
    getIndustryAndRole: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/getIndustryAndResearcher`, query),
    //查询文件下载地址
    queryDownLoadUrl: (query) => api.get(`${config.interfaces.type10}maat-admin/file/download`, query),
    //券池审批导出
    exportApproval: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/export`, query),
    //券池查询导出
    exportQuery: (query) => api.get(`${config.interfaces.type5}portfolio-server/SecurityPoolItem/export`, query),
    //获取新增自动审批时维度为申万一级内容
    searchContentOne: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/getFinduInfo`, query),
    //获取新增自动审批时维度为申万二级内容
    searchContentTwo: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/getSinduInfo`, query),
    //获取内部评级
    getInternalRating: (query) => api.get(`${config.interfaces.type5}portfolio-server/flowSecurity/getRatingByTenant`, query),
  };
}
